import {Component} from '@angular/core';
import {ModalController, NavController, NavParams} from 'ionic-angular';
import {HTTP} from "@ionic-native/http";


@Component({
  selector: 'news-details',
  templateUrl: 'news-details.html'
})
export class NewsDetailsPage {

  news = {content: ""};

  constructor(public navCtrl: NavController, public navParam: NavParams, public  http: HTTP, public  modal: ModalController) {
    this.loadData();
  }

  private loadData() {

    this.http.get("http://39.105.46.29:8080/api/news/finance/id", {id:this.navParam.data.id}, {})
      .then(res => {
        this.news = JSON.parse(res.data)
      })
  }

  private back(){
    this.navCtrl.pop();
  }



}
